package org.example.service.impl;

import java.util.List;

import org.example.domain.UtuFollower;
import org.example.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.mapper.UtuFollowingMapper;
import org.example.domain.UtuFollowing;
import org.example.service.IUtuFollowingService;

/**
 * 关注信息Service业务层处理
 *
 * @author coderfun
 * @date 2024-12-04
 */
@Service
public class UtuFollowingServiceImpl implements IUtuFollowingService {
    @Autowired
    private UtuFollowingMapper utuFollowingMapper;

    /**
     * 查询关注信息
     *
     * @param id 关注信息主键
     * @return 关注信息
     */
    @Override
    public UtuFollowing selectUtuFollowingById(Long id) {
        return utuFollowingMapper.selectUtuFollowingById(id);
    }

    /**
     * 查询关注信息列表
     *
     * @param utuFollowing 关注信息
     * @return 关注信息
     */
    @Override
    public List<UtuFollowing> selectUtuFollowingList(UtuFollowing utuFollowing) {
        return utuFollowingMapper.selectUtuFollowingList(utuFollowing);
    }

    /**
     * 新增关注信息
     *
     * @param utuFollowing 关注信息
     * @return 结果
     */
    @Override
    public int insertUtuFollowing(UtuFollowing utuFollowing) {
        utuFollowing.setUpdateTime(DateUtils.getNowDate());
        return utuFollowingMapper.insertUtuFollowing(utuFollowing);
    }

    /**
     * 修改关注信息
     *
     * @param utuFollowing 关注信息
     * @return 结果
     */
    @Override
    public int updateUtuFollowing(UtuFollowing utuFollowing) {
        utuFollowing.setUpdateTime(DateUtils.getNowDate());
        return utuFollowingMapper.updateUtuFollowing(utuFollowing);
    }

    /**
     * 批量删除关注信息
     *
     * @param ids 需要删除的关注信息主键
     * @return 结果
     */
    @Override
    public int deleteUtuFollowingByIds(Long[] ids) {
        return utuFollowingMapper.deleteUtuFollowingByIds(ids);
    }

    /**
     * 删除关注信息信息
     *
     * @param id 关注信息主键
     * @return 结果
     */
    @Override
    public int deleteUtuFollowingById(Long id) {
        return utuFollowingMapper.deleteUtuFollowingById(id);
    }

    @Override
    public List<UtuFollowing> selectFlowingList(UtuFollower utuFollower) {
        return utuFollowingMapper.selectFlowingList(utuFollower);
    }
}
